﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Text.RegularExpressions;

namespace FAQFrameworks
{
    public class StringEncoder
    {
        public static string ContentToHtml(string str)
        {
            str = HttpUtility.HtmlEncode(str);

            str = str.Replace("\r\n", "<br/>");
            str = str.Replace("  ", "&nbsp;&nbsp;");

            return str;
        }

        // todo: 生成HTML等功能
        static Regex fooHtmlRegex;

        static StringEncoder()
        {
            fooHtmlRegex = new Regex(@"<foo:html>(.+)</foo:html>");
        }

        public static string FooParseHTML(string str)
        {
            throw new NotImplementedException();
        }
    }
}
